package com.xpgk.mvc.productPrice;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.jfinal.log.Log;
import com.xpgk.annotation.Table;
import com.xpgk.mvc.base.BaseModel;
import com.xpgk.mvc.organization.Organization;

@SuppressWarnings("unused")
@Table(tableName = Price.table_name)
public class Price extends BaseModel<Price> {

	private static final long serialVersionUID = 3587707164798029923L;
	
	private static final Log log = Log.getLog(Price.class);

	public static final Price dao = new Price().dao();

	/**
	 * 表名称
	 */
	public static final String table_name = "sb_shop_price";
	


	/**
	 * 字段描述：主键 字段类型：character varying 长度：32
	 */
	public static final String column_ids = "ids";
	
	/**
	 * 字段描述：名称 字段类型：character varying 长度：25
	 */
	public static final String column_name = "name";
	
	/**
	 * 字段描述：层级int 长度：2
	 */
	public static final String column_level = "level";

	/**
	 * 字段描述: 是否父节点 string 长度：5
	 */
	public static final String column_isparent = "isparent";
	
	/**
	 * 字段描述: 父节点ids string 长度：32
	 */
	public static final String column_parentids = "parentids";

	/**
	 * 字段描述: 序号 string 长度：11
	 */
	public static final String column_orderid = "orderid";

	/**
	 * 字段描述：添加时间
	 */
	public static final String column_addTime = "addTime";
	
	/**
	 * 字段描述：机构ids
	 */
	public static final String column_organizationIds = "organizationIds";
	
	/**
	 * 字段描述：该条数据添加人员is  字段类型：character varying 长度：32
	 */
	public static final String column_createId = "createId";
	/**
	 * 字段描述：该条数据添加时间  字段类型：datetime 长度：0
	 */
	public static final String column_createDate = "createDate";
	/**
	 * 字段描述：该条数据更新人员id  字段类型：character varying 长度：100
	 */
	public static final String column_updateId = "updateId";
	/**
	 * 字段描述：该条数据更新时间  字段类型：datetime 长度：0
	 */
	public static final String column_updateDate = "updateDate";
	
	/**
	 * 字段描述：状态 string 长度：1
	 */
	public static final String column_dataStatus = "dataStatus";
	
	/**
	 * sqlId 描述：查询是否使用
	 */
	public static final String sqlId_isUse = "sys.price.isUse";
	
	/**
	 * sqlId 描述：根据上级节点id查询子节点数量
	 */
	public static final String sqlId_childCount = "sys.price.childCount";
	
	/**
	 * sqlId 描述：根据上级节点id查询子节点
	 */
	public static final String sqlId_childNode = "sys.price.childNode";
	
	/**
	 * sqlId 描述：自定义查询
	 */
	public static final String sqlId_column = "sys.price.column";
	

	/**
	 * sqlId 描述：自定义查询
	 */
	public static final String sqlId_column1 = "sys.price.column1";
	
	/**
	 * sqlId 描述：分页select
	 */
	public static final String sqlId_splitPageSelect = "sys.price.splitPageSelect";
	
	/**
	 * sqlId 描述：分页from
	 */
	public static final String sqlId_splitPageFrom = "sys.price.splitPageFrom";
	
	/**
	 * 查找指定机构下的所有价格表
	 * @param organIds
	 * @return
	 */
	public List<Price> findByOrgan(String organIds){
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("column", Price.column_organizationIds);
		String sql = getSqlByBeetl(Price.sqlId_column1, param);
		return dao.find(sql, organIds);
	}

}
